<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{$title}</title>
<!-- Import google fonts - Heading first/ text second -->
<link rel='stylesheet' type='text/css' href='http://fonts.useso.com/css?family=Open+Sans:400,700|Droid+Sans:400,700' />
<!--[if lt IE 9]>
<link href="http://fonts.useso.com/css?family=Open+Sans:400" rel="stylesheet" type="text/css" />
<link href="http://fonts.useso.com/css?family=Open+Sans:700" rel="stylesheet" type="text/css" />
<link href="http://fonts.useso.com/css?family=Droid+Sans:400" rel="stylesheet" type="text/css" />
<link href="http://fonts.useso.com/css?family=Droid+Sans:700" rel="stylesheet" type="text/css" />
<![endif]-->
<!-- Favicon and touch icons -->
<link rel="shortcut icon" href="__PUBLIC__/admin/assets/ico/favicon.ico" type="image/x-icon" />
<!-- Css files -->
<link href="__PUBLIC__/admin/assets/css/bootstrap.min.css" rel="stylesheet">
<link href="__PUBLIC__/admin/assets/css/jquery.mmenu.css" rel="stylesheet">
<link href="__PUBLIC__/admin/assets/css/font-awesome.min.css" rel="stylesheet">
<link href="__PUBLIC__/admin/assets/plugins/jquery-ui/css/jquery-ui-1.10.4.min.css" rel="stylesheet">
<link href="__PUBLIC__/admin/assets/css/style.min.css" rel="stylesheet">
<link href="__PUBLIC__/admin/assets/css/add-ons.min.css" rel="stylesheet">
<script src="__PUBLIC__/admin/assets/js/jquery-2.1.1.min.js"></script> 
<link href="__PUBLIC__/yz_arrle/yz_arrle.css" rel="stylesheet">
<script src="__PUBLIC__/yz_arrle/yz_arrle.js" ></script> 
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<SCRIPT LANGUAGE=javascript>   
$(function(){ 
   $(".look").click(function(){ 
      var id = $(this).attr("leve");
	  var look= $(this).prop("checked");
	  if(look==false){ 
	    look=1;
	  }else{ 
	    lokk=0;
	   }
	 //状态ajax  
	 $.ajax({ 
		type: "POST",
		url: "test.json",
		data: {id:id, look:look},
		dataType: "json",
	    url:"{:U('news/yumi_update_ajax')}",
		success:function(data){ 
		  var s= eval(data);
          yz_alert(1,s.mag);
		},
		error:function(){ 
		  yz_alert(0,"ajax错误");
		} 
	 });
 });
});
</SCRIPT>
<body>
 
<!-- start: Header --> 
<include file="./head" /> 
<!-- end: Header -->
<div class="container-fluid content">
<div class="row"> 
  <!-- start: Main Menu --> 
  <include file="./slide" /> 
  <!-- end: Main Menu --> 
  <!-- start: Content -->
  <div class="main sidebar-minified">
    <div class="row">
      <div class="col-lg-8">
        <div class="panel panel-default">
          <div class="panel-heading">
            <h2><i class="fa fa-table red"></i><span class="break"></span><strong>{$title}</strong></h2>
            <div class="panel-actions"> <a href="table.html#" class="btn-setting"><i class="fa fa-rotate-right"></i></a> <a href="table.html#" class="btn-minimize"><i class="fa fa-chevron-up"></i></a> </div>
          </div>
          <div class="panel-body"> 
           <a class="btn btn-success" href="{:U("News/add_yumi")}">添加域名</a> 
          </div>
          <div class="panel-body">
            <table class="table table-striped table-bordered bootstrap-datatable datatable"  >
              <thead>
                <tr>
                  <th style="width:4%"> ID</th>
                  <th>域名</th>
                  <th style="width:10%">状态 </th>
                  <th style="width:10%;">部署模块</th>
                  <th style="width:10%;">文章总数</th>
                  <th>百分比</th>
                  <th>操作</th
                </tr>
              </thead>
              <tbody id="app">
                <?php foreach($yumi_list as $v):?>
                <tr >
                  <td > {$v['id']}</td>
                  <td>{$v['url']}</td>
                  <td >
                    <div class="col-md-1 col-sm-2 col-xs-3"  >
                    <label class="switch switch-primary">
                    <input type="checkbox"   class="switch-input look" leve="<?php echo $v['id'];?>" <?php if(!$v['look']){?> checked <?php }?> >
                    <span class="switch-label" data-on="On" data-off="Off"></span>
                    <span class="switch-handle"></span>
                    </label>
                    </div>
                  </td>
                  <td>
                    {:yumi_type($v['type'])}
                   </td>

                  <td>
                  <?php $zs = M("News")->where("yumi_id=".$v['id'])->count(); echo $zs;?>
                   </td>
                   <td>
                    
                    <div class="progress">
                    <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo baifenbi($zs,$news_count);?>;">
                    <?php echo baifenbi($zs,$news_count);?>
                    </div>
                    </div>
                                            
                   </td>
                   <td>
                   <a class="btn btn-info" href="{:U("News/yumi_update/",array('id'=>$v['id']))}"> <i class="fa fa-edit "></i> </a>
                   </td>
                </tr>
                <?php endforeach;?>
              </tbody>
            </table>
            <?php if($page){?>
            <ul class="pagination">
             <?php echo $page; ?>
            </ul>
            <?php }?>
            
          </div>
        </div>
      </div>
      <!--/col--> 
      
    </div>
  </div>
</div>
 <include file="./foot" /> 
</body>
</html>